﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

public partial class Views_module_category : System.Web.UI.UserControl
{
    CategoryBus categoryBus;
    private string categoryList = "";
    public DataTable dt;

public string CategoryList
{
  get { return categoryList; }
  set { categoryList = value; }
}

    protected void Page_Load(object sender, EventArgs e)
    {
        categoryBus = new CategoryBus();
        GetAllCategory();
    }

    private void GetAllCategory()
    {
        dt = new DataTable();

        dt = categoryBus.GetAllCategory();

        foreach (DataRow r in dt.Rows)
        {
            categoryList += "<li><a href='default.aspx?category=" + r["category_id"] + "'>" + r["category_name"].ToString().Trim() + "</a></li>";
        }
    }
}